package com.mq.rabbitmq.aspect;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class RabbitMqContextAspect {
	protected final transient Log log = LogFactory.getLog(getClass());

	@Pointcut("@annotation(com.mq.rabbitmq.aspect.RabbitMqContext)")
	public void methodCachePointcut() {
	}

	//这里当前线程setLoginUser,
	@Around("methodCachePointcut()")
	public Object control(ProceedingJoinPoint joinPoint) throws Throwable {
		System.out.println("staaaaaaaaaaaaa=");
		Object result = joinPoint.proceed();
		System.out.println("atereew=");
		return  result;
	}
}
